<template>
  <div style="width: 200px; height: 200px; background-color: skyblue; margin: 20px;">
son2--{{ money }}
<button @click="change">点击改变父组件title属性值</button>
  </div>
</template>

<script setup>
import {ref} from 'vue'
import mitt from '@/utils/bus'
import {useAttrs} from 'vue'

const attrs = useAttrs()
const emits = defineEmits(['changeTitle'])
const money = ref(10)
console.log(attrs);

const change = () => {
  emits('changeTitle', '我是修改后的标题')
}

mitt.on('add', (val) => {
  money.value += val.money
})

</script>

<style lang="scss" scoped>

</style>